﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DEMO3
{
    public partial class nav : UserControl
    {
    
        public nav()
        {
            InitializeComponent();
        }

        public bool Selected
        {
            get
            {
                return _selected;
            }
            set
            {
                _selected = value;
            }
        }

        private bool _selected = false;
        private void nav_Load(object sender, EventArgs e)
        {
            if( this.Tag != null)
                lbTieude.Text = this.Tag.ToString();
        }

        private void nav_MouseHover(object sender, EventArgs e)
        {
            if (Selected == false)
            {
                this.BackgroundImage = null;
                this.BackColor = Color.FromArgb(96, 186, 227);
                lbTieude.ForeColor = Color.White;
            }
        }

        private void nav_MouseLeave(object sender, EventArgs e)
        {
            if (Selected == false)
            {
                this.BackgroundImage = DEMO3.Properties.Resources.navbg;
                this.BackColor = Color.Transparent;
                lbTieude.ForeColor = Color.Gray;
            }
        }

        private void nav_MouseClick(object sender, MouseEventArgs e)
        {
            this.BackgroundImage = null;
            this.BackColor = Color.FromArgb(223, 133, 0);
            lbTieude.ForeColor = Color.White;
        }
    }
}
